package controleImpl;

import interfaceGrafica.GUI;
import controleInterface.MotorInterface;

public class MotorImpl implements MotorInterface {
	
	private boolean up;
	private boolean stopped;
	private int e;
	
	public MotorImpl(int elev){
		if (e == 1){
			
			GUI.v().updateLampDirection(1, true, true);
		}
		else{
			GUI.v().updateLampDirection(2, true, true);
		}
		stopped = true;
	}
	
	public boolean isUp() {
		return up;
	}

	public boolean isStopped() {
		return stopped;
	}

	public void stop(int elevator) {
		
		if (elevator == 1){
			GUI.v().updateLampDirection(1, true, true);
			
		}
		else{
			GUI.v().updateLampDirection(2, true, true);
		}
		stopped = true;
	}

	public void up(int elevator) {
		
		if (elevator == 1){
			GUI.v().updateLampDirection(1, false, true);
			
		}
		else{
			GUI.v().updateLampDirection(2, false, true);
		}
		up = true;
	}

	public void down(int elevator) {
		
		if (elevator == 1){
			GUI.v().updateLampDirection(1, true, false);
			
		}
		else{
			GUI.v().updateLampDirection(2, true, false);
		}
		up = false;
	}

}
